package com.janko.springbootbase.a_projectExample.collection.set;

import java.util.HashSet;

/**
 * @Author janko
 * @Version 1.0
 * @date 2021/5/16 1:25
 * @Description 类文件说明
 */
public class MyHashSet {
    public static void main(String[] args) {
        HashSet<Integer> hs=new HashSet<>();
        hs.add(1);
        hs.add(2);
        hs.add(3);
        hs.add(2);
        hs.add(4);
        System.out.println(hs);

        HashSet<SetPerson> hsPerson=new HashSet<SetPerson>();
        hsPerson.add(new SetPerson(1,"a"));
        hsPerson.add(new SetPerson(2,"b"));
        hsPerson.add(new SetPerson(1,"a"));
        System.out.println(hsPerson.toString());
    }
}
